<html>
  <head>
    <meta http-equiv="content-type" content="text/html; charset=utf-8"/>
    <meta name="viewport" content="initial-scale=1.0, user-scalable=no" />
    <title>谷歌地图V3</title>
    <style type="text/css">
      body, #map_canvas {
        border: none;
        padding: 0;
        margin: 0;
      }
    </style>
    <script src="http://maps.google.com/maps/api/js?hl=zh-CN&sensor=false" type="text/javascript">
    </script>
    <script type="text/javascript">
      var map;
      function initialize(){
        var container = document.getElementById("map_canvas");
        var latlng = new google.maps.LatLng(39.917, 116.397);
        var myOptions = {
          zoom: 10,
          center: latlng,
          mapTypeId: google.maps.MapTypeId.HYBRID
        };
        map = new google.maps.Map(container, myOptions);
        var marker = new google.maps.Marker({
          position: latlng,
          map: map
        });
        var infowindow = new google.maps.InfoWindow({
          content: "<h3>Hello, Google Maps API V3</h3>"
        });
        google.maps.event.addListener(marker, 'click', function(){
          var content = "<h3>Hello, Google Maps API V3</h3>";
          infowindow.set_content(content);
          infowindow.open(map, marker);
        });
        google.maps.event.addListener(marker, 'dblclick', function(){
          var content = "<h3>喂，你双击我了 :)</h3>";
          infowindow.set_content(content);
          infowindow.open(map, marker);
        });
        google.maps.event.addListener(marker, 'rightclick', function(){
          var content = "<h3>哇塞，你右键单击我了 :)</h3>";
          infowindow.set_content(content);
          infowindow.open(map, marker);
        });
        google.maps.event.addListener(infowindow, 'content_changed', function(){
          marker.set_title(infowindow.get_content());
        });
      }
    </script>
  </head>
  <body onload="initialize()">
    <div id="map_canvas" style="width:100%; height:100%">
    </div>
  </body>
</html>
